abstract type LinkedList{T} end

mutable struct Node
    item::Any
    next::Node
end
# 头插法 创建链表
function Hcrweate_linklist(li::Vector)
    head = li[1]
    for element in li[2:length(li)]
        node = Node(element,nothing)
        node.next = head
        head = node
    end

    return head
end

# 尾插法 创建链表
function Tcrweate_linklist(li::Vector)
    head = Node(li[1],nothing)
    tail = head
    for element in li[2:length(li)]
        node = Node(element,nothing)
        tail.next = node
        tail = node
    end
    return head
end

function print_linklist(li::Node)
    point = li
    while point !== nothing
        print(point.item," ")
        point = point.next
    end
    println()
end

lk = Tcrweate_linklist([1,2,3,4])
print_linklist(lk)

lp = lk
print_linklist(lp)